package com.usian.mapper;

import com.usian.pojo.Etc;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface EtcMapper {

    List<Etc> findAll(Etc etc);

    @Insert("insert into etc value(null,#{carId},#{etcId},#{money},#{userName},#{lateYear})")
    void add(Etc etc);

    @Update("update etc set carId=#{carId},etcId=#{etcId},money=#{money},userName=#{userName},lateYear=#{lateYear} where id=#{id}")
    void update(Etc etc);

    @Delete("delete from etc where id=#{id}")
    void delete(Integer id);

    @Select("select * from etc where id = #{id}")
    Etc findById(Integer id);

    List<Etc> findAllBy1(Etc etc);
}
